package com.xiaoq.matrix.activity.service.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.xiaoq.apis.activity.ActivityInfo4Vo;
import com.xiaoq.apis.activity.IActivityApi;
import com.xiaoq.matrix.activity.entity.ActivityEntity;
import com.xiaoq.matrix.activity.repository.IActivityRepository;

@Service(interfaceClass=IActivityApi.class,version="1.0.0")
public class ActivityDubboServiceImpl implements IActivityApi {
	
	@Autowired
	private IActivityRepository activityRep;
	
	private static final Logger LOG = LoggerFactory.getLogger(ActivityDubboServiceImpl.class);

	@Override
	public ActivityInfo4Vo findActivityInfo4Vo(String id) {
		ActivityEntity activity = activityRep.findActivity(id);
		ActivityInfo4Vo activityInfo = null;
		if(activity!=null){
			activityInfo = new ActivityInfo4Vo();
			BeanUtils.copyProperties(activity, activityInfo);
		}else{
			LOG.info("ActivityInfo4Vo 查询的结果为空！");
		}
		return activityInfo;
	}

}
